package ds.students;

import ds.interfaces.Queue;

/**
 * @author simont
 *
 */
public class DSQueue extends Queue {
	
	public DSQueue(Queue s) {
		list = new DSList(s.list);
	}

	public DSQueue() {
		list = new DSList();
	}

	@Override
	public boolean offer(Token t) {
		return list.add(t);
	}

	@Override
	public Token poll() {
		Token remove = list.remove(0);
		return remove;
	}

	@Override
	public Token peek() {
		Token token = list.get(0);
		return token;
	}

	@Override
	public String toString() {
		return list.toString();
	}

	@Override
	public int size() {
		return list.size();
	}

	@Override
	public boolean isEmpty() {
		return list.isEmpty();
	}

}
